import os

images_dir = '/home/jario/dataset/dota2.0_train_split_600x600_scale_1_05/images'

with open('/home/jario/dataset/dota2.0_train_split_600x600_scale_1_05/test.txt', 'w') as tt:
    for f in os.listdir(images_dir):
        if f.endswith('.png'):
            fn = os.path.splitext(f)[0]
            print(fn)
            tt.write(fn + '\n')
